package com.ruoyi.house.service.param;

import com.ruoyi.house.dto.SysUserInfo;
import com.ruoyi.house.enums.UserType;
import org.apache.shiro.SecurityUtils;

@lombok.Getter
@lombok.Setter
@lombok.ToString
public class BusinessBaseParam extends BaseParam {
	SysUserInfo loginUser;
	Long deptId;
	Long businessId;
	String deptNo;
	
	public BusinessBaseParam() {
		super(UserType.B_USER);
		SysUserInfo user = (SysUserInfo)SecurityUtils.getSubject().getPrincipal();
		if (user != null) {
			this.loginUser = user;
			this.loginUserId = user.getUserId();
			this.deptId = user.getDeptId();
			this.deptNo = user.getDeptNo();
			if (user.getBusinessId() != null) {
				this.businessId = user.getBusinessId().longValue();
			}
		}
	}
	
	
}
